from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action
from forms.army_handler import ArmyHandler

class FormStark(Room):
    
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
    
    # return description of room.
    def get_description(self):
        return '''
        You are now going to choose soldiers for Stark
         '''
    
    # return image of room
    def get_image(self):
        return 'victory.jpg'

class FormStarkHandler(ArmyHandler):
        
    def get_template(self, request, game):
        return "Choose.html"

    # Post Abstract methods
    #######################
    
    def update_game(self, request, game):
        game.archer = request.get('archer')
    
    def get_destination(self, request, game):
        return 'battle'



class Lannister(Room):
    
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # build list of actions
        self.add_action(Choose)
    
    def get_description(self):
        return ''' '''
    # return image of room

class LannisterHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Lannister
    
    def get_template(self):
        return 'Choose.html'

# define actions for this room

class Choose(Action):
    def __init__(self):
        Action.__init__(self, "Choose")    # do basic initialization for every action
    
    def get_description(self):
        return "Begin the battle"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'battle'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "post"
